
<%
if Request("bComm")<>"restart" then
		if Session("Started") ="no" then
			Response.Redirect("..\Error.asp?ErrorCode=1")
		end if
end if
%>
<%
Session("FormName")="F36"
%>
<!--#include file=..\checkSession.inc-->
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language=javascript>
	function openW(sObj) {
	  popupWin = window.open('Search.asp','new_page','width=300,height=300');
	}
	function openWE(sObj) {
	  popupWin = window.open('SearchE.asp','new_page','width=300,height=300');
	}
</script>
<%
On Error Resume next	
	IDFlow = Request("IDFlow")
	bComm = Request("bComm")
	nodeid = Request("id")
Set Cls=server.CreateObject("Vinalines.ClsFunction")	
	Response.Write "<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>"   
    Response.Write "function conf() {"
    Response.Write "if(!confirm('Bạn có muốn xóa không!')){"
    Response.Write "return false;"
    Response.Write "}"
    Response.Write "}"
    If Request("bComm") = "add" Then
    Response.Write "function OnChangeNhom(){"
        Response.Write "if(frmnoidung.Chk.checked){"
            Response.Write "frmnoidung.Canbo.disabled=true;"
            Response.Write "frmnoidung.luong.disabled=true;"
            Response.Write "frmnoidung.nhom.disabled=false;"
            Response.Write "frmnoidung.Chkluong.checked=false;"
            Response.Write "frmnoidung.nhom.focus();"
        Response.Write "}"
        Response.Write "else{"
            Response.Write "frmnoidung.nhom.disabled=true;"
            Response.Write "frmnoidung.luong.disabled=true;"
            Response.Write "frmnoidung.Canbo.disabled=false;"
            Response.Write "frmnoidung.Chkluong.checked=false;"
            Response.Write "frmnoidung.Canbo.focus();"
        Response.Write "}"
    Response.Write "}"
    Response.Write "function OnChangeLuong(){"
        Response.Write "if(frmnoidung.Chkluong.checked){"
            Response.Write "frmnoidung.Canbo.disabled=true;"
            Response.Write "frmnoidung.luong.disabled=false;"
            Response.Write "frmnoidung.nhom.disabled=true;"
            Response.Write "frmnoidung.Chk.checked=false;"
            Response.Write "frmnoidung.luong.focus();"
        Response.Write "}"
        Response.Write "else{"
            Response.Write "frmnoidung.nhom.disabled=true;"
            Response.Write "frmnoidung.luong.disabled=true;"
            Response.Write "frmnoidung.Canbo.disabled=false;"
            Response.Write "frmnoidung.Chk.checked=false;"
            Response.Write "frmnoidung.Canbo.focus();"
        Response.Write "}"
    Response.Write "}"
    Response.Write "function CmdBack_onclick() {"
            Response.Write "frmnoidung.Target = 'right';"
            Response.Write "frmnoidung.action='frmTvFlowNode.asp?IDFlow=" + IDFlow + "';"
            Response.Write "frmnoidung.submit();"
	Response.Write "}"
    Response.Write "function CmdOK_onclick() {"
            Response.Write "frmnoidung.Target = 'right';"            
          Response.Write "if(frmnoidung.Chk.checked){"
        Response.Write "if(frmnoidung.nhom.value==''){"
            Response.Write "alert('Cho biết nhóm xử lý');"
            Response.Write "frmnoidung.nhom.focus();"
            Response.Write "return false;"
        Response.Write "}"
              'Response.Write "frmnoidung.action='node/add.asp?bNhom=ok&bMaRoot=" + bMaRoot + "&Trangthai=" + Request("Trangthai") + "&MaflowNode=" + Cls.Mahoa(Request("Maflownode")) + "&IDFlow=" + Request("IDFlow") + "&Nguoitao=" + Nguoitao + "&Filename=" + Filename + "';"
              Response.Write "frmnoidung.action='node/add.asp?bNhom=nhom&MaflowNode=" + Cls.Mahoa(Request("Maflownode")) + "&IDFlow=" + Request("IDFlow") + "';"
              Response.Write "}"
        Response.Write "else{"
        Response.Write "if(frmnoidung.Chkluong.checked){"
        Response.Write "if(frmnoidung.luong.value==''){"
            Response.Write "alert('Cho biết luồng xử lý');"
            Response.Write "frmnoidung.luong.focus();"
            Response.Write "return false;"
        Response.Write "}"
              Response.Write "frmnoidung.action='node/add.asp?bNhom=luong&IDFlow=" + Request("IDFlow") + "';"
        Response.Write "}"
        Response.Write "else"
        Response.Write "{"
        Response.Write "if(frmnoidung.Canbo.value==''){"
            Response.Write "alert('Cho biết người xử lý');"
            Response.Write "frmnoidung.Canbo.focus();"
            Response.Write "return false;"
        Response.Write "}"
        'Response.Write "frmnoidung.action='node/add.asp?bMaRoot=" + bMaRoot + "&MaflowNode=" + Cls.Mahoa(Request("Maflownode")) + "&IDFlow=" + Request("IDFlow") + "&Nguoitao=" + Nguoitao + "';"
        Response.Write "frmnoidung.action='node/add.asp?IDFlow=" + Request("IDFlow") + "';"
        Response.Write "}"
        Response.Write "}"
            Response.Write "frmnoidung.submit();"
        Response.Write "}"
    end if
    If bComm = "edit" Then
        Response.Write "function CmdBack_onclick() {"
            Response.Write "frmedit.Target = 'right';"
            Response.Write "frmedit.action='frmTvFlowNode.asp?IDFlow=" + IDFlow + "';"
            Response.Write "frmedit.submit();"
			Response.Write "}"
            Response.Write "function CmdOK_onclick() {"
            Response.Write "frmedit.Target = 'right';"
            'Response.Write "frmedit.action='frmTvFlowNode.asp?bComm=editok&IDFlow="+ IDFlow +"&nodeid="+ nodeid +"';"
            Response.Write "frmedit.action='node/edit.asp?IDFlow="+ IDFlow +"&nodeid="+ nodeid +"';"
            Response.Write "frmedit.submit();"
        Response.Write "}"
    end if
    If bComm <> "edit" And bComm <> "add" Then
        Response.Write "function CmdQuaylai_onclick() {"
            Response.Write "frm.target='right';"
            Response.Write "frm.action='frmTvWorkFlow.asp';"
            Response.Write "frm.submit();"
        Response.Write "}"
    End If
Response.Write "</SCRIPT>"
Set Cls=nothing    	
%>
<!--#include file="..\jvfunction.inc"-->
<%
set TvWFlow=server.CreateObject("Vinalines.ClsWorkflow")
	if TvWFlow.OpenConn (Application("StrConn")) then
		call TvWFlow.Tvflow			
%>

<SCRIPT ID=clientEventHandlersVB LANGUAGE=VBscript>
<%if request("bComm")="add" then%>
	function TxtSearch_onchange() 
		for each pt in frmnoidung.Canbo
			if instr(1,pt.value,frmnoidung.TxtSearch.value,vbTextCompare) then
				frmnoidung.Canbo.value=pt.value
				exit for
			end if
		next
	end function
<%end if%>
<%if request("bComm")="edit" then%>
function TxtSearchE_onchange() 
	for each pt in frmedit.Canbo
		if instr(1,pt.value,frmedit.TxtSearch.value,vbTextCompare) then
			frmedit.Canbo.value=pt.value
			exit for
		end if
	next
end function
<%end if%>
</script>
<%
		TvWFlow.CloseConn
	else
		Response.Redirect("..\Error.asp?ErrorCode=2")		
	End if
	if Err.number then
		%><p align=center><font face=Arial color=red size=4>Lỗi ! Không đặc tả 
được lỗi <br><a href=frmTvWorkflow.asp>Quay lại</a></font><%
	End if 
	Err.Clear
%>